var checkEncoding = function(request){
	//压缩方式
    var contentEncoding = '';
    var acceptEncoding = request.headers['accept-encoding'];
    if (!acceptEncoding) {
        acceptEncoding = '';
    }

    // Note: this is not a conformant accept-encoding parser.
    // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
    if (acceptEncoding.match(/\bgzip\b/)) {
        contentEncoding = 'gzip';
    } else if (acceptEncoding.match(/\bdeflate\b/)) {
        contentEncoding = 'deflate';
    }
    
    return contentEncoding;
}

exports.checkEncoding = checkEncoding;